<?php
namespace app\webadmin\model;
use think\Db;
use think\Model;
class Article extends Model{

    protected $table = 'my_table_article';
    protected $resultSetType = 'conllection';

    public function insertArticle($data){
		try{
			if(is_null($data)){
				return array('code'=>502,'msg'=>'参数错误');
			}else{
				$insert = $this->insert($data);
				if($insert){
					return array('code'=>0,'msg'=>'内容添加成功');
				}else{
					return array('code'=>2,'msg'=>'内容添加失败');
				}
			}
		}catch(Exception $e){
			return array('code'=>1,'msg'=>'操作异常');
		}
    }
}